home *** CD-ROM | disk | FTP | other *** search
/ EnigmA Amiga Run 1999 March / EnigmA AMIGA RUN 35 (1999)(G.R. Edizioni)(IT)[!][issue 1999-03].iso / earcd / devel / libx11 / include / x11 / xwdfile.h < prev   
C/C++ Source or Header  |  1999-01-01  |  4KB  |  99 lines

  1. /* $XConsortium: XWDFile.h,v 1.14 91/01/06 12:18:26 rws Exp $ */
  2. /* Copyright 1985, 1986, Massachusetts Institute of Technology */
  3.  
  4. /*
  5. Permission to use, copy, modify, distribute, and sell this software and its
  6. documentation for any purpose is hereby granted without fee, provided that
  7. the above copyright notice appear in all copies and that both that
  8. copyright notice and this permission notice appear in supporting
  9. documentation, and that the name of M.I.T. not be used in advertising or
  10. publicity pertaining to distribution of the software without specific,
  11. written prior permission.  M.I.T. makes no representations about the
  12. suitability of this software for any purpose.  It is provided "as is"
  13. without express or implied warranty.
  14. */
  15.  
  16. /*
  17.  * XWDFile.h    MIT Project Athena, X Window system window raster
  18.  *        image dumper, dump file format header file.
  19.  *
  20.  *  Author:    Tony Della Fera, DEC
  21.  *        27-Jun-85
  22.  * 
  23.  * Modifier:    William F. Wyatt, SAO
  24.  *              18-Nov-86  - version 6 for saving/restoring color maps
  25.  */
  26.  
  27.  
  28. /*
  29.  * This is not portable between machines of differing word sizes.  To make
  30.  * it portable, do the following things:
  31.  *
  32.  *     o  #include <X11/Xmd.h>
  33.  *     o  remove the typedef for xwdval
  34.  *     o  replace all instances of xwdval with the appropriate CARD32 ... B32
  35.  *     o  make sure that XWDFileHeader is padded to quadword boundaries
  36.  *     o  make sure the window name is written out quadword aligned
  37.  *     o  create an XWDColor structure that contains the same fields as XColor
  38.  *        but which is defined in terms of CARD32 B32, CARD16 B16, and CARD8
  39.  *     o  convert XColor structures to XWDColor structures in xwd
  40.  *     o  remove all xwdval casts from xwd
  41.  *     o  pack image data before writing out if necessary
  42.  *     o  replace casts from xwdval objects in xwud with cvtINT macros
  43.  *     o  convert XWDColor structures to XColor structures
  44.  *     o  unpack data after reading in if necessary
  45.  */
  46.  
  47.  
  48. #include <X11/Xmd.h>
  49.  
  50. #define XWD_FILE_VERSION 7
  51. #ifdef WORD64
  52. #define sz_XWDheader 104
  53. #else
  54. #define sz_XWDheader 100
  55. #endif
  56. #define sz_XWDColor 12
  57.  
  58. typedef CARD32 xwdval;        /* for old broken programs */
  59.  
  60. typedef struct _xwd_file_header {
  61.     CARD32 header_size B32;  /* Size of the entire file header (bytes). */
  62.     CARD32 file_version B32;    /* XWD_FILE_VERSION */
  63.     CARD32 pixmap_format B32;    /* Pixmap format */
  64.     CARD32 pixmap_depth B32;    /* Pixmap depth */
  65.     CARD32 pixmap_width B32;    /* Pixmap width */
  66.     CARD32 pixmap_height B32;    /* Pixmap height */
  67.     CARD32 xoffset B32;        /* Bitmap x offset */
  68.     CARD32 byte_order B32;        /* MSBFirst, LSBFirst */
  69.     CARD32 bitmap_unit B32;        /* Bitmap unit */
  70.     CARD32 bitmap_bit_order B32;    /* MSBFirst, LSBFirst */
  71.     CARD32 bitmap_pad B32;        /* Bitmap scanline pad */
  72.     CARD32 bits_per_pixel B32;    /* Bits per pixel */
  73.     CARD32 bytes_per_line B32;    /* Bytes per scanline */
  74.     CARD32 visual_class B32;    /* Class of colormap */
  75.     CARD32 red_mask B32;        /* Z red mask */
  76.     CARD32 green_mask B32;        /* Z green mask */
  77.     CARD32 blue_mask B32;        /* Z blue mask */
  78.     CARD32 bits_per_rgb B32;    /* Log2 of distinct color values */
  79.     CARD32 colormap_entries B32;    /* Number of entries in colormap */
  80.     CARD32 ncolors B32;        /* Number of Color structures */
  81.     CARD32 window_width B32;    /* Window width */
  82.     CARD32 window_height B32;    /* Window height */
  83.     CARD32 window_x B32;        /* Window upper left X coordinate */
  84.     CARD32 window_y B32;        /* Window upper left Y coordinate */
  85.     CARD32 window_bdrwidth B32;    /* Window border width */
  86. #ifdef WORD64
  87.     CARD32 header_end B32;        /* Pad to fill out word */
  88. #endif
  89. } XWDFileHeader;
  90.  
  91. typedef struct {
  92.         CARD32    pixel B32;
  93.         CARD16    red B16;
  94.     CARD16    green B16;
  95.     CARD16    blue B16;
  96.         CARD8    flags;
  97.         CARD8    pad;
  98. } XWDColor;
  99.